package com.huluobo.h3weekdemo.net

import com.huluobo.h3weekdemo.main.NewBeanResult
import com.huluobo.h3weekdemo.main.TabBeanResult
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Query

/**
 *  Created by LC on 2023/10/31.
 */
interface ApiService {
    @GET(Const.URL_TYPE)
    fun getHomeTabs(): Observable<TabBeanResult>

    @GET(Const.URL_NEWS)
    fun getNews(
        @Query(Const.PARAM_CURRENT_PAGE) currentPage: Int,
        @Query(Const.PARAM_NEWS_TYPE_ID) id: Int,
        @Query(Const.PARAM_PAGE_SIZE) pageSize: Int
    ): Observable<NewBeanResult>

    @GET(Const.URL_SEARCH_NEWS)
    fun searchNews(
        @Query(Const.PARAM_CURRENT_PAGE) currentPage: Int,
        @Query(Const.PARAM_NEWS_TYPE_ID) id: Int,
        @Query(Const.PARAM_PAGE_SIZE) pageSize: Int,
        @Query(Const.PARAM_KEYWORD) keyword: String
    ): Observable<NewBeanResult>
}